#include <iostream>
#include <cstring>



class BankAcount
{
public:
    BankAcount(std::string name);
    void deposit(double amount);
    void withdraw(double amount); 
    void display();

private:
    std::string name;
    double sum;



};

BankAcount::BankAcount(std::string name):sum(0),name(name)
{

}

void BankAcount::deposit(double amount)
{
    this->sum = this->sum + amount; 
}

void BankAcount::withdraw(double amount)
{
    if(this->sum - amount < 0)
    {
        std::cout<<"您的余额不足!"<<std::endl;
        return;
    }
    this->sum = this->sum - amount;

}

void BankAcount::display()
{
    std::cout<<"您的账户名是："<<this->name<<std::endl;
    std::cout<<"您的余额是："<<this->sum<<std::endl;
    std::cout<<std::endl;
}




int main()
{
    BankAcount z("张三");

    z.display();

    z.deposit(10.25);

    z.display();

    z.deposit(87.3);

    z.display();

    z.withdraw(100);

    z.display();


    return 0;
}
